﻿using Learun.Application.TwoDevelopment.ZZDT_EC;
using Learun.Util;
using Learun.Util.SqlSugar;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.Web.Http;

namespace Learun.Application.Web.AppApi
{
    /// <summary>
    /// 工程数据属性接口
    /// </summary>
    [RoutePrefix("api/EnginedataPropertyApi")]
    [HandlerApiLogin(FilterMode.Enforce)]
    [TokenAuthorize]
    public class EnginedataPropertyApiController : WebApiControllerBase
    {
        private ec_enginedata_propertyIBLL ec_enginedata_propertyIBLL = new ec_enginedata_propertyBLL();
        /// <summary>
        /// 更新默认工程数据属性
        /// </summary>
        /// <returns></returns>
        [HttpPost]
        public IHttpActionResult UpdateEnginePropByDefault(string ProjId)
        {
            try
            {
                ec_enginedata_propertyIBLL.UpdateEnginePropByDefault(ProjId);
                return Success("更新成功");
            }
            catch (Exception ex)
            {
                return Fail(ex.Message);
            }
        }
        /// <summary>
        /// 插入缺少的工程数据属性
        /// </summary>
        /// <returns></returns>
        [HttpPost]
        public IHttpActionResult InsertEnginePropByDefault(string ProjId)
        {
            try
            {
                ec_enginedata_propertyIBLL.InsertEnginePropByDefault(ProjId);
                return Success("插入成功");
            }
            catch (Exception ex)
            {
                return Fail(ex.Message);
            }
        }

#if DEBUG
 
#endif
    }
}
